<%--
  Created by IntelliJ IDEA.
  User: yanchao
  Date: 2021/11/7
  Time: 下午4:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>贷款管理 - 助学贷款管理系统</title>
    <link rel="stylesheet" href="./static/layui/css/layui.css">
    <link rel="stylesheet" href="./static/admin/css/style.css">
    <script src="./static/layui/layui.js"></script>
    <script src="./static/js/jquery-3.3.1.min.js"></script>
    <script src="./static/js/vue.min.js"></script>
    <script src="./static/admin/js/userConfig.js"></script>
</head>
<body class="p20">
<div class="layui-row">
    <form class="form-inline" action="" method="get">
        <div class="layui-col-lg8">
            <div class="layui-input-inline" style="width: 300px">
                <input type="text" name="realname" value="" placeholder="姓名" class="layui-input key">
            </div>
            <button type="submit" class="layui-btn sou">查询</button>
        </div>
    </form>
</div>

<table class="layui-table layui-form">

    <thead>
    <tr>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>学校</th>
        <th>专业</th>
        <th>困难等级</th>
        <th>申请金额</th>
        <th>申请期限</th>
        <th>申请时间</th>
        <th>审核状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${sessionScope.audits}" var="audit" varStatus="status">
        <tr class="id36567">
            <td>${audit.user.realname}</td>
            <td>${audit.user.sex}</td>
            <td>${audit.user.age}</td>
            <td>${audit.user.school}</td>
            <td>${audit.user.major}</td>
            <td>${audit.level}</td>
            <td>${audit.amount}</td>
            <td>${audit.deadline}</td>
            <td><fmt:formatDate value="${audit.applydate}" type="date" pattern="yyyy-MM-dd"/></td>
            <c:if test="${audit.status == 0}"><td>待审核</td></c:if>
            <c:if test="${audit.status == 2}"><td>未通过</td></c:if>
            <td>
                <button type="button" class="layui-btn layui-btn-sm" onclick="adminDoAuditApply(${audit.id})">审核</button>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="adminDoRejectApply(${audit.id})">驳回</button>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<script src="./static/admin/js/script.js"></script>
<script type="text/javascript" language="javascript">
    function adminDoAuditApply(id) {
        var message=confirm("你确定要审核这条信息吗？");
        if(message===true)
        {
            window.location.href="/adminDoAuditApply.do?id=" + id;
        }
        else if(message==false)
        {
            window.location.href="/adminAuditApply.do";
        }
    }
    function adminDoRejectApply(id) {
        var message=confirm("你确定要驳回这条信息吗？");
        if(message===true)
        {
            window.location.href="/adminDoRejectApply.do?id=" + id;
        }
        else if(message==false)
        {
            window.location.href="/adminAuditApply.do";
        }
    }
</script>
</body>
</html>
